//
//  QSCompanyCell.m
//  DigitalEconomy_iOS
//
//  Created by Ding on 2020/4/22.
//  Copyright © 2020 DingC. All rights reserved.
//

#import "QSCompanyCell.h"

@implementation QSCompanyCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)layoutSubviews{
    self.backgroundColor = [UIColor clearColor];
    self.contentView.layer.cornerRadius = 8;
    self.contentView.layer.masksToBounds = YES;
    self.contentView.backgroundColor = [UIColor QSColorWhiteFFFFFF];
    [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.equalTo(self.mas_leading).offset(kRealValue(10));
        make.trailing.equalTo(self.mas_trailing).offset(kRealValue(-10));
        make.top.equalTo(self.mas_top).offset(kRealValue(10));
        make.bottom.equalTo(self.mas_bottom).offset(kRealValue(0));
    }];
    self.leftImageView.layer.cornerRadius = 2;
    self.leftImageView.layer.masksToBounds = YES;
    self.leftImageView.contentMode = UIViewContentModeScaleAspectFill;
}

- (void)setModel:(QSProblemCompanyModel *)model{
    _model = model;
    self.nameLabel.text = model.label;
    self.streetLabel.text = model.street;
    if (model.pic) {
        [self.leftImageView sd_setImageWithURL:[NSURL URLWithString:model.pic]];
    }else{
        [self.leftImageView setImage:[UIImage imageNamed:@"ic_nulllogo"]];
    }
}

- (void)setBindingEnterprisesModel:(QSVisitInfoCompanyListModel *)bindingEnterprisesModel{
    _bindingEnterprisesModel = bindingEnterprisesModel;
    self.nameLabel.text = bindingEnterprisesModel.companyName;
    self.streetLabel.text = bindingEnterprisesModel.townshipName;
    if (bindingEnterprisesModel.logoUrl) {
        [self.leftImageView sd_setImageWithURL:[NSURL URLWithString:bindingEnterprisesModel.logoUrl]];
    }else{
        [self.leftImageView setImage:[UIImage imageNamed:@"ic_nulllogo"]];
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    // Configure the view for the selected state
}

@end
